﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace System.Models.Models
{
    /// <summary>
    /// 菜单表
    /// </summary>
    [Table("T_System_Menus")]
    public class Menus:BaseEntity
    {
        /// <summary>
        /// 菜单父Id
        /// </summary>
        [ForeignKey(nameof(MenusId))]
        public int? Pid { get; set; }
        public Menus MenusId { get; set; }
        /// <summary>
        /// 菜单名
        /// </summary>
        [Required,Column(TypeName ="varchar"),StringLength(100)]
        public string Title { get; set; }
        /// <summary>
        /// 菜单图标
        /// </summary>
        [Required, Column(TypeName = "varchar"), StringLength(100)]
        public string Icon { get; set; }
        /// <summary>
        /// 菜单调转链接
        /// </summary>
        [Column(TypeName = "varchar"), StringLength(100)]
        public string Href { get; set; }
        /// <summary>
        /// 链接打开方式 ，默认_self
        /// </summary>
        [Required, Column(TypeName = "varchar"), StringLength(20)]
        public string Target { get; set; } = "_self";

        /// <summary>
        /// 菜单排序
        /// </summary>
        public int? Sort { get; set; } = 0;
        /// <summary>
        /// 菜单状态 默认true启用
        /// </summary>
        [Required]
        public bool Status { get; set; } = true;
        

    }
}
